/*
    1、定义枚举类，枚举出日志等级
    2、提供转换接口，将枚举转换为对应的字符串
*/

#ifndef _M__LEVEL_H_
#define _M__LEVEL_H_

namespace log{
    class LogLevel{
        public:
            enum class value{
                UNKNOW = 0,
                DEBUG,
                INFO,
                WARNING,
                ERROR,
                FATAL,
                OFF
            };

            static const char *toString(value level){
                switch (level)
                {
                case value::DEBUG:
                    return "DEBUG";
                case value::INFO:
                    return "INFO";
                case value::WARNING:
                    return "WARNING";
                case value::ERROR:
                    return "ERROR";
                case value::FATAL:
                    return "FATAL";
                case value::OFF:
                    return "OFF";
                }
                return "UNKNOW";
            }
    };
}

#endif